<template>
  <div>
    <!-- <el-checkbox
      :indeterminate="isIndeterminate"
      v-model="checkAll"
      @change="handleCheckAllChange"
      >全选</el-checkbox
    >
    <div style="margin: 15px 0"></div>
    <el-checkbox-group
      v-model="checkedCities"
      @change="handleCheckedCitiesChange"
    >
      <el-checkbox v-for="city in cities" :label="city" :key="city">{{
        city
      }}</el-checkbox>
    </el-checkbox-group> -->
  </div>
</template>
<script>
const cityOptions = ["上海", "北京", "广州", "深圳"];
export default {
  created() {
    //一.文字：
    let arr = [
      { station: "融创未来中心充电站" },
      { station: "碧桂园充电站" },
      { station: "图书馆充电站" },
    ];
    //1.判断文字相等
    let arr1 = [];
    arr.forEach((item) => {
      if (item.station == "融创未来中心充电站") {
        arr1.push(item);
      }
    });
    console.log(arr1);
    //2.判断文字不相等
    let arr2 = [];
    arr.forEach((item) => {
      if (item.station !== "融创未来中心充电站") {
        arr2.push(item);
      }
    });
    console.log(arr2);
    //3.判断文字相等...或不相等...
    let arr3 = [];
    arr.forEach((item) => {
      if (
        item.station == "融创未来中心充电站" ||
        item.station !== "碧桂园充电站"
      ) {
        arr3.push(item);
      }
    });
    console.log(arr3);
    //4.判断文字相等...并且不相等...
    let arr4 = [];
    arr.forEach((item) => {
      if (
        item.station == "融创未来中心充电站" &&
        item.station !== "碧桂园充电站"
      ) {
        arr4.push(item);
      }
    });
    console.log(arr4);
    //5.判断文字相等...或者相等...
    let arr5 = [];
    arr.forEach((item) => {
      if (
        item.station == "融创未来中心充电站" ||
        item.station == "碧桂园充电站"
      ) {
        arr5.push(item);
      }
    });
    console.log(arr5);
    //6.判断文字相等...并且相等...
    let arr6 = [];
    arr.forEach((item) => {
      if (
        item.station == "融创未来中心充电站" &&
        item.station == "碧桂园充电站"
      ) {
        arr6.push(item);
      }
    });
    console.log(arr6);
    //7.判断文字相等...并且开头是...
    let arr7 = [];
    arr.forEach((item) => {
      if (
        item.station == "融创未来中心充电站" &&
        item.station.indexOf("创") == 0
      ) {
        arr7.push(item);
      }
    });
    console.log(arr7);
    //8.判断文字相等...或开头是...
    let arr8 = [];
    arr.forEach((item) => {
      if (
        item.station == "融创未来中心充电站" ||
        item.station.indexOf("碧") == 0
      ) {
        arr8.push(item);
      }
    });
    console.log(arr8);
    //9.判断文字相等...或开头不是...
    let arr9 = [];
    arr.forEach((item) => {
      if (
        item.station == "融创未来中心充电站" ||
        item.station.indexOf("碧") !== 0
      ) {
        arr9.push(item);
      }
    });
    console.log(arr9);
    //10.判断文字相等...并且开头不是...
    let arr10 = [];
    arr.forEach((item) => {
      if (
        item.station == "融创未来中心充电站" &&
        item.station.indexOf("碧") !== 0
      ) {
        arr10.push(item);
      }
    });
    console.log(arr10);
    //11.判断文字相等...并且结尾是...
    let arr11 = [];
    arr.forEach((item) => {
      if (
        item.station == "融创未来中心充电站" &&
        item.station.endsWith("充电站")
      ) {
        arr11.push(item);
      }
    });
    console.log(arr11);
    //12.判断文字相等...或结尾是...
    let arr12 = [];
    arr.forEach((item) => {
      if (
        item.station == "融创未来中心充电站" ||
        item.station.endsWith("充电站")
      ) {
        arr12.push(item);
      }
    });
    console.log(arr12);
    //13.判断文字相等...或结尾不是...
    let arr13 = [];
    arr.forEach((item) => {
      if (
        item.station == "融创未来中心充电站" ||
        item.station.endsWith("充电站") == false
      ) {
        arr13.push(item);
      }
    });
    console.log(arr13);
    //14.判断文字相等...并且结尾不是...
    let arr14 = [];
    arr.forEach((item) => {
      if (
        item.station == "融创未来中心充电站" &&
        item.station.endsWith("充电站") == false
      ) {
        arr14.push(item);
      }
    });
    console.log(arr14);
    //15.判断文字相等...并且包含...
    let arr15 = [];
    arr.forEach((item) => {
      if (
        item.station == "融创未来中心充电站" &&
        item.station.indexOf("充电站") != -1
      ) {
        arr15.push(item);
      }
    });
    console.log(arr15);
    //16.判断文字相等...或包含...
    let arr16 = [];
    arr.forEach((item) => {
      if (
        item.station == "融创未来中心充电站" ||
        item.station.indexOf("充电站") != -1
      ) {
        arr16.push(item);
      }
    });
    console.log(arr16);
    //17.判断文字相等...或不包含...
    let arr17 = [];
    arr.forEach((item) => {
      if (
        item.station == "融创未来中心充电站" ||
        item.station.indexOf("充电站") == -1
      ) {
        arr17.push(item);
      }
    });
    console.log(arr17);
    //18.判断文字相等...并且不包含...
    let arr18 = [];
    arr.forEach((item) => {
      if (
        item.station == "融创未来中心充电站" &&
        item.station.indexOf("充电站") == -1
      ) {
        arr18.push(item);
      }
    });
    console.log(arr18);
    console.log("相等+其他全部--------------------------------");
    // const bbb = this.tableData.filter((node) => {
    //   // node
    // });
    // const aaa = (node) => {
    //   //
    // };
    //   this.tableData.filter(aaa);
  },
  data() {
    return {
      checkAll: false,
      checkedCities: ["上海", "北京"],
      cities: cityOptions,
      isIndeterminate: true,
    };
  },
  methods: {
    handleCheckAllChange(val) {
      this.checkedCities = val ? cityOptions : [];
      this.isIndeterminate = false;
    },
    handleCheckedCitiesChange(value) {
      let checkedCount = value.length;
      this.checkAll = checkedCount === this.cities.length;
      this.isIndeterminate =
        checkedCount > 0 && checkedCount < this.cities.length;
    },
  },
};
</script>